 // 返回顶部按钮
 (function() {
     const backToTopButton = document.getElementById('back-to-top');

     window.addEventListener('scroll', () => {
         if (window.pageYOffset > 300) {
             backToTopButton.classList.remove('opacity-0', 'invisible');
             backToTopButton.classList.add('opacity-100', 'visible');
         } else {
             backToTopButton.classList.add('opacity-0', 'invisible');
             backToTopButton.classList.remove('opacity-100', 'visible');
         }
     });

     backToTopButton.addEventListener('click', () => {
         window.scrollTo({
             top: 0,
             behavior: 'smooth'
         });
     });
 })();
